<?php
/**
 * Created by PhpStorm.
 * User: kb130
 * Date: 2017/9/8
 * Time: 10:56
 */

namespace util\validate\rules;

/**
 * 必须为浮点数，且保留2位小数
 * Class Double2
 * @package util\validate\rules
 */
class Double2 extends BaseRule
{

    public function verify()
    {
        return preg_match('/^[0-9]+(.[0-9]{1,2})?$/', $this->value) ? true : false;
    }
}